<?php
/**
 * 
 * @author return
 *	公告数据模型
 */
class Announce extends CActiveRecord
{
	public static function model($classname=__CLASS__)
	{
		return parent::model($classname);
	}
	public function tableName()
	{
		return "announce";
	}
	public function rules()
	{
			return array(
					array('from_user_id,from_user_name,type,subject,content,sort,status,create_time', 'safe'),
			);
				
	}
	public function beforeSave()
	{
		if($this->isNewRecord)
			$this->create_time=$this->update_time=time();
		
		return true;
	}
}